package cloud.simple;

import org.apache.thrift.TException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class WatchClientController {

	@ResponseBody
	@RequestMapping(value = "/wclint")
	public String wclint() throws TException {
		if(WatchClient.zkMap.isEmpty()){
			try {
				WatchClient.updateServerList();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return WatchClient.zkMap.toString();
	}
}
